<%@page import="java.io.OutputStream"%>
<%@page import="org.jrimum.bopepo.view.BoletoViewer"%>
<%@page import="org.jrimum.bopepo.Boleto"%>

<%
Boleto boleto = (Boleto)request.getAttribute("boleto");

BoletoViewer viewer = new BoletoViewer(boleto);
byte[] pdfAsBytes = viewer.getPdfAsByteArray();

response.setContentType("application/pdf");
//response.setHeader("Content-Disposition", "attachment; filename=boleto.pdf");

OutputStream output = response.getOutputStream();
output.write(pdfAsBytes);

response.flushBuffer();
%>